package com.caipos.actor.device;


import com.caipos.actor.ActorSystemContext;
import com.caipos.actor.common.actors.KbActor;
import com.caipos.actor.common.actors.KbActorId;
import com.caipos.actor.common.actors.KbEntityActorId;
import com.caipos.actor.common.data.id.DeviceId;
import com.caipos.actor.common.data.id.TenantId;
import com.caipos.actor.service.ContextBasedCreator;

public class DeviceActorCreator extends ContextBasedCreator {

    private final TenantId tenantId;
    private final DeviceId deviceId;

    public DeviceActorCreator(ActorSystemContext context, TenantId tenantId, DeviceId deviceId) {
        super(context);
        this.tenantId = tenantId;
        this.deviceId = deviceId;
    }

    @Override
    public KbActorId createActorId() {
        return new KbEntityActorId(deviceId);
    }

    @Override
    public KbActor createActor() {
        return new DeviceActor(context, tenantId, deviceId);
    }

}
